package sysu.el.array.algors;

public class MaxElem {
	static public int Int(int num, int elems[]){
		return MaxElem.Int(num, elems, Integer.MIN_VALUE);
	}
	
	static public int Int(int num, int elems[], int init){
		int max = init;
		for (int i=0; i<num; i++)
			if (max < elems[i])
				max = elems[i];
		return max;
	}

	static public float Float(int num, float elems[]){
		return Float(num, elems, Float.MIN_VALUE);
	}
	
	static public float Float(int num, float elems[], float init){
		float max = init;
		for (int i=0; i<num; i++)
			if (max < elems[i])
				max = elems[i];
		return max;
	}
	
	
	static public double Double(int num, double elems[]){
		return Double(num, elems, Double.MIN_VALUE);
	}
	
	static public double Double(int num, double elems[], double init){
		double max = init;
		for (int i=0; i<num; i++)
			if (max < elems[i])
				max = elems[i];
		return max;
	}
}
